/*
 * @Description: 策划会议数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2021-08-30 15:15:46
 * @LastEditTime: 2023-02-23 17:29:48
 * @FilePath: \cscec-pms-admin\src\views\project\projectPlanningMeeting\model.js
 */
import OrgTreeSelect from '@/components/OrgTreeSelect'
// 会议级别列表
const meetingLevelList = [
  {
    value: '1',
    label: '分公司级',
  },
  {
    value: '2',
    label: '公司级',
  },
  {
    value: '3',
    label: '局级',
  }
]
// 按钮权限
const btnPermission = {
  add: 'pm_061_add_02',
  delete: 'pm_061_del_03',
  view: 'pm_061_loo_01',
  upload: 'pm_061_chz_05',
  select: 'pm_061_exp_04',
  all: 'pm_061_exp_04',
  review: 'pm_061_psy_06'
}
// 搜索列表
const searchOption = [
  {
    name: '所属单位',
    valueKey: 'searchQuery',
    type: OrgTreeSelect,
  },
  {
    name: '会议名称',
    value: 'meetingName',
    type: 'input'
  },
  {
    name: '会议级别',
    value: 'meetingLevel',
    type: 'select',
    data: meetingLevelList
  },
  {
    name: '会议时间',
    value: 'startEndDate',
    type: 'dateRange'
  },
  {
    name: '状态',
    value: 'meetingStatus',
    type: 'select',
    data: [
      {
        value: '20',
        label: '待开始',
        color: '#1890ff'
      },
      {
        value: '30',
        label: '进行中',
        color: '#70B603'
      },
      {
        value: '40',
        label: '已完结',
        color: '#666666'
      }
    ]
  }
]
// 新增会议表单项
const formOption = [
  {
    label: '所属单位',
    type: 'orgTree',
    keyName: 'projectId',
    rules: [{ required: true, message: '请选择', trigger: 'change' }],
    span: 16,
    isAutoSelectFirst: true,
    isNeedAuth: true,
    checkStrictly: true,
    isQueryProjecDetail: false
  },
  {
    label: '会议名称',
    keyName: 'meetingName',
    type: 'BaseInput',
    rules: [{ required: true, message: '请输入', trigger: 'change' }]
  },
  {
    label: '会议级别',
    keyName: 'meetingLevel',
    type: 'a-select',
    data: [
      {
        value: '1',
        label: '分公司级',
      },
      {
        value: '2',
        label: '公司级',
      },
      {
        value: '3',
        label: '局级',
      }
    ],
    rules: [{ required: true, message: '请选择', trigger: 'change' }]
  },
  {
    label: '主持人/主讲人',
    keyName: 'speakerId',
    slot: true,
    rules: [{ required: true, message: '请输入', trigger: 'change' }]
  },
  {
    label: '会议地点',
    keyName: 'meetingPlace',
    type: 'BaseInput',
    rules: [{ required: true, message: '请输入', trigger: 'change' }]
  },
  {
    label: '会议时间',
    keyName: 'meetingTime',
    type: 'a-date-picker',
    attrs: {
      showTime: { format: 'HH:mm' },
      format: 'YYYY-MM-DD HH:mm',
      valueFormat: 'YYYY-MM-DD HH:mm'
    },
    rules: [{ required: true, message: '请选择', trigger: 'change' }]
  },
  {
    label: '创建人',
    keyName: 'createUser',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '创建时间',
    keyName: 'createTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '会议说明',
    keyName: 'meetingExplain',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    rules: [{ required: true, message: '请输入', trigger: 'change' }],
    span: 24
  }
]
// 查看会议表单项
const formOption1 = [
  {
    label: '所属单位',
    type: 'orgTree',
    keyName: 'projectId',
    span: 16,
    isAutoSelectFirst: true,
    isNeedAuth: true,
    checkStrictly: true,
    isQueryProjecDetail: false,
    disabled: true
  },
  {
    label: '会议名称',
    keyName: 'meetingName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '会议级别',
    keyName: 'meetingLevel',
    type: 'a-select',
    data: [
      {
        value: '1',
        label: '分公司级',
      },
      {
        value: '2',
        label: '公司级',
      },
      {
        value: '3',
        label: '局级',
      }
    ],
    disabled: true
  },
  {
    label: '主持人/主讲人',
    keyName: 'speaker',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '会议地点',
    keyName: 'meetingPlace',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '会议时间',
    keyName: 'meetingTime',
    type: 'a-date-picker',
    attrs: {
      showTime: { format: 'HH:mm' },
      format: 'YYYY-MM-DD HH:mm',
      valueFormat: 'YYYY-MM-DD HH:mm'
    },
    disabled: true
  },
  {
    label: '创建人',
    keyName: 'createUser',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '创建时间',
    keyName: 'createTime',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '会议说明',
    keyName: 'meetingExplain',
    type: 'BaseTextarea',
    attrs: {
      maxLength: 3000
    },
    disabled: true,
    span: 24
  },
  {
    label: '参会人数',
    keyName: 'signNum',
    slot: true
  },
  {
    label: '会议纪要',
    keyName: 'meetingSummary',
    type: 'BaseTextarea',
    autoSize: { minRows: 20, maxRows: 25 },
    attrs: {
      maxLength: 30000
    },
    rules: [{ required: true, message: '请输入', trigger: 'change' }],
    span: 24
  }
]
// 评审意见表头
const columns = [
  {
    title: '序号',
    dataIndex: 'serial',
    width: '10%',
    customRender() {
      return arguments[2] + 1
    }
  },
  {
    title: '评审意见',
    dataIndex: 'reviewComments'
  },
  {
    title: '创建人',
    dataIndex: 'creatorName',
    width: 220
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180
  },
  {
    title: '操作',
    key: 'action',
    width: '20%',
    scopedSlots: { customRender: 'action' }
  }
]
// 评审意见表单项
const formOption2 = [
  {
    label: '创建人',
    keyName: 'creatorName',
    type: 'BaseInput',
    disabled: true,
    span: 12
  },
  {
    label: '创建时间',
    keyName: 'createTime',
    type: 'BaseInput',
    disabled: true,
    span: 12
  },
  {
    label: '评审意见',
    keyName: 'reviewComments',
    type: 'BaseTextarea',
    autoSize: { minRows: 20, maxRows: 25 },
    attrs: {
      maxLength: 3000
    },
    span: 24
  },
  {
    label: '附件',
    keyName: 'fileInfoList',
    slot: true,
    span: 24
  }
]
// 会议列表表头
const columns1 = [
  {
    title: '序号',
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '分公司',
    dataIndex: 'branchComName'
  },
  {
    title: '项目名称',
    dataIndex: 'projectName'
  },
  {
    title: '会议名称',
    dataIndex: 'meetingName'
  },
  {
    title: '会议级别',
    dataIndex: 'meetingLevel',
    customRender: (text, record, index) => {
      return meetingLevelList.find(el => el.value === text)?.label || ''
    }
  },
  {
    title: '会议时间',
    dataIndex: 'meetingTime'
  },
  {
    title: '参会人数',
    dataIndex: 'signNum'
  },
  {
    title: '状态',
    dataIndex: 'meetingStatusName',
    scopedSlots: { customRender: 'status' }
  },
  {
    title: '操作',
    dataIndex: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export {
  btnPermission,
  searchOption,
  formOption,
  formOption1,
  columns,
  formOption2,
  columns1
}